package com.shijun.tankwar;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhushijun on 2018/1/18 0018.
 */

public class LiveEntityManager {

    private static LiveEntityManager liveEntityManager = new LiveEntityManager();
    private List<FreedomMoveEntity> entitys;

    private LiveEntityManager(){
        entitys = new ArrayList<>();
    }

    public LiveEntityManager getInstance(){
        return liveEntityManager;
    }

    public void addEntity(FreedomMoveEntity entity){
        entitys.add(entity);
    }

    public void removeEntity(int entityId){
        for(FreedomMoveEntity freedomMoveEntity:entitys){
            if(freedomMoveEntity.get_id()==entityId){
                entitys.remove(freedomMoveEntity);
            }
        }
    }
}
